{layout name="layout" /}
<link rel="stylesheet" href="/static/layuiNetCompany/res/static/css/list.css"/>

<!-- banner部分 -->
<div class="banner">
    <div class="title">
        <p>{$title}展示</p>
        <p class="subhead">网站建设 / 微信开发 / UI设计 / 平面设计</p>
        <p class="en">Thoughtful loving credible powerful and courageous</p>
    </div>
</div>
<!-- main部分 -->
<div class="main">

    <div class="title">
        <p class="gradient">我们的{$title}</p>
        <p class="subhead">丰富的互联网经验，十分专业的开发团队</p>
    </div>

    <div class="list" id="list"></div>

    <div id="page" style="font-size: 48px;margin-bottom: 196px;"></div>

</div>


<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
    layui.config({
        base: '/static/layuiNetCompany/res/static/js/'
    }).use(['jquery', 'layer', 'laypage'], function () {
        let $ = layui.$
            , layer = layui.layer
            , laypage = layui.laypage;

        let count = 1;
        let size = 10;
        let page = 1;
        let show = false;

        getData();

        function getData() {
            $.get("{$url}?size=" + size + "&page=" + page, function (data) {
                //console.log(data);
                //console.log(data.data.title);
                let html = "";
                $.each(data.data, function (index, val) {
                    let href = "/index/{$type}/detail/id/" + val.id;
                    html += "<div class=\"card\"><a href=\"" + href + "\" target=\"_blank\">" +
                        "<img src=\"" + val.phy + "\">" +
                        "<p>" + val.title + "</p>" +
                        "<div>" + val.detail + "</div></a></div>"
                });

                $("#list").html(html);
                //console.log(html);
                if (!show) {
                    laypage.render({
                        elem: 'page'
                        , count: count
                        , limit: size
                        , theme: '#1E9FFF'
                        , jump: function (obj, first) {
                            if (!first) {
                                //layer.msg('第 ' + obj.curr + ' 页');
                                page = obj.curr;
                                getData();
                            }
                        }
                    });
                    show = true;
                }
            });
        }
    }).use('firm');
</script>
